Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vehicles hear exterior audio #36

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

Doubleumc
Copy link
Contributor

@Doubleumc Doubleumc commented Oct 31, 2023

About the pull request

The problem in question is described in this report: cmss13-devs/cmss13#4777

First issue is the interior spaces were not being detected as interiors. For instance, deployables were supposed to be blocked from deploying in interiors. They were being blocked, but not because it was an interior: they were blocked by the turfs themselves being marked as not buildable. Instead of the It's too cramped in here to deploy ... message, you'd get You can't set up ... here. The cause was the interior subsystem populating the used_turfs with weakrefs to a specific type, then in_interior() checking if that list returned that specific type. It didn't, because weakrefs to a type aren't that type: old
Fixed by checking for weakrefs instead: new

Second issue exposed by fixing the first: the used_turfs list could contain turfs that weren't in an interior. Not an issue in most cases, but the sound system would check if a turf was in an interior then check which interior index it was. get_interior_by_coords() failed to find an interior and returned FALSE, which is equivalent to 0 and the sound system used that as the index and errored out: old
Fixed by returning null on failure instead: new

Third is the audio was now playing, but only in part of the interior. The interior's center wasn't being calculated correctly, and was being pinned in the top right corner: old
Fixed by correctly averaging the positions of the corners: new

Finally, the interior's dimensions were flipped, assigning the height to width and vice-versa: old
Corrected here: new

Explain why it's good for the game

Vehicle interiors being able to hear their own gunfire, movement sounds, as well as external fighting is cool and good.

Testing Photographs and Procedure

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
fix: vehicle interiors can hear exterior noises
/:cl:

@morrowwolf morrowwolf merged commit a367c55 into cmss13-devs:master Nov 1, 2023
29 checks passed
@Doubleumc Doubleumc deleted the vehicle-exterior-audio branch November 3, 2023 20:25
xDanilcusx pushed a commit to xDanilcusx/PvE-CMSS13 that referenced this pull request Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants